
/*==============================================================*/
/* Table: {organ.code}_FILE                                             */
/*==============================================================*/
CREATE TABLE {organ.code}_FILE (
   ID                   bigint          NOT NULL,
   LOGIC_ID             bigint          NOT NULL,
   ORGAN_LOGIC_ID       bigint          NULL,
   OBJ_TYPE             VARCHAR(50)          NULL,
   OBJ_LOGIC_ID         bigint          NOT NULL,
   OLD_FILE_NAME        VARCHAR(100)         NULL,
   NEW_FILE_NAME        VARCHAR(50)          NULL,
   FILE_LENGTH          NUMERIC(20,0)        NULL,
   FILE_TYPE            VARCHAR(20)          NULL,
   PATH                 VARCHAR(100)         NULL,
   FILE_ORDER           INT                  NULL,
   TEMP_ID              bigint          NULL,
   DOC_TYPE             VARCHAR(50)          NULL,
   FILE_URL             VARCHAR(100)         NULL,
   USER_ID              bigint          NULL,
   CREATE_TIME          DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_FILE PRIMARY KEY NONCLUSTERED (ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_FILE_DOWN                                        */
/*==============================================================*/
CREATE TABLE {organ.code}_FILE_DOWN (
   ID                   INT                  IDENTITY,
   ORGAN_LOGIC_ID       bigint          NULL,
   FILE_LOGIC_ID        bigint          NOT NULL,
   OBJ_LOGIC_ID         bigint          NULL,
   DOWNLOAD_TIME        DATETIME             NULL,
   MAC                  VARCHAR(50)          NULL,
   IP                   VARCHAR(50)          NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_FILE_DOWN PRIMARY KEY NONCLUSTERED (ID)
)
go

/*==============================================================*/
/* Table: {organ.code}_FILE_LOG                                         */
/*==============================================================*/
CREATE TABLE {organ.code}_FILE_LOG (
   ID                   INT                  IDENTITY,
   ORGAN_LOGIC_ID       bigint          NULL,
   FILE_LOGIC_ID        bigint          NOT NULL,
   OBJ_LOGIC_ID         bigint          NULL,
   LOG_TIME             DATETIME             NULL,
   OLD_FILE_NAME        VARCHAR(100)         NULL,
   NEW_FILE_NAME        VARCHAR(50)          NULL,
   FILE_LENGTH          NUMERIC(20,0)        NULL,
   FILE_TYPE            VARCHAR(20)          NULL,
   PATH                 VARCHAR(100)         NULL,
   FILE_ORDER           INT                  NULL,
   TEMP_ID              bigint          NULL,
   DOC_TYPE             VARCHAR(50)          NULL,
   FILE_URL             VARCHAR(100)         NULL,
   USER_ID              bigint         NULL,
   CREATE_TIME          DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_FILE_LOG PRIMARY KEY NONCLUSTERED (ID)
)
go
